package com.liuyi.netty.im.lychat.modular.controller.model;

import com.liuyi.netty.im.commons.codes.data.event.Message;
import com.liuyi.netty.im.commons.codes.data.event.message.playload.Playload;
import com.liuyi.netty.im.lychat.modular.enums.MessageType;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;

/**
 * @author Mr.Fmy
 * @since 2021/12/31
 */
public class MessageUserRecordsModel {

    @Data
    @ApiModel("MessageUserRecordsModel-ResultList")
    public static class ResultList implements Serializable {

        @ApiModelProperty(value = "是否结束，true表明结束，也就是无消息记录可读")
        private boolean finished;

        @ApiModelProperty(value = "消息列表")
        private List<Message<? extends Playload>> messages;
    }

    @Data
    @ApiModel("MessageUserRecordsModel-SendMessage")
    public static class SendMessage implements Serializable {

        @ApiModelProperty(value = "消息id")
        private Long messageId;
    }

    @Data
    @ApiModel("MessageUserRecordsModel-CreateMessage")
    public static class CreateMessage implements Serializable {

        @ApiModelProperty(value = "会话id", required = true)
        @NotEmpty
        private String sessionId;

        @ApiModelProperty(value = "消息类型", required = true)
        @NotNull
        private MessageType contentType;

        @ApiModelProperty(value = "消息体", required = true)
        @NotNull
        private Object content;
    }
}
